﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using log4net;
using UniryDemo2WEB.Service;
using Unity.Attributes;

namespace UniryDemo2WEB.Controllers
{
    public class HomeController : Controller
    {

        [Dependency]

        public IProductService ProductService { get; set; }

        private static ILog logger = LogManager.GetLogger("HomeController");
        public ActionResult Index()
        {
            //logger.Error("HomeController|Index|ceshi");
            //logger.Info("HomeController|Index|ceshi2");
            //logger.Debug("HomeController|Index|ceshi2");

            try
            {
                int result = 0;
                int x = 1, y = 0;
                result = x / y;
            }
            catch { }
           
            
            ProductService.ClassName = "124";
            string str = ProductService.ShowInfo();
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}